<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
  props: {
    size: { type: String, default: "32rpx" },
    color: { type: String, default: "#666666" },
  },
});
</script>

<template>
  <view class="icon-close" :style="{ fontSize: size }">
    <view class="icon-close-left" :style="{ backgroundColor: color }"></view>
    <view class="icon-close-right" :style="{ backgroundColor: color }"></view>
  </view>
</template>

<style lang="scss">
.icon-close {
  position: relative;
  width: 1em;
  height: 1em;

  .icon-close-left,
  .icon-close-right {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0.1em;
    height: 1em;
    border-radius: 1rpx;
    transform: translate(-50%, -50%) rotate(-45deg);
  }

  .icon-close-right {
    transform: translate(-50%, -50%) rotate(45deg);
  }
}
</style>